package cn.edu.sig.controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import cn.edu.sig.bean.User;


@Controller
public class CommonController {
	
	
	
	@RequestMapping(value="main.html",method = RequestMethod.GET)
	public String mainPage(){
		return "main";
	}
	@RequestMapping(value="login.html",method = RequestMethod.GET)
	public String loginPage(){
		return "login";
	}
	@RequestMapping(value="publish.html",method = RequestMethod.GET)
	public String publishPage(
			@RequestParam(value="code", required = true)String code,
			Model model){
		
		if(code != null){
			User user = new User();
			user.setCode(code);
			model.addAttribute("user", user);
		}
		return "publish";
	}
	
	
	
}
